Wish List
Note: Spartacus 4.x is no longer maintained. Please upgrade to the latest version.
Note: Spartacus 4.x was tested with SAP Commerce Cloud versions 1905 to 2205. Spartacus 4.x has not been verified to work with (and is not guaranteed to work with) SAP Commerce Cloud 2211 or later releases.
Note: This feature is introduced with version 1.4 of the Spartacus libraries.
The Wish List feature lets you save products for later viewing.
Usage
You can add products to a wish list from the product details page. If you are not signed in, the “Add to Wish List” option will indicate that you need to be logged in before you can add a product to the wish list.
Once you have added items to the wish list, you can view the contents of your wish list through the Wish list option in the My Account menu.
Customizing
The wish list feature consists of the AddToWishListComponent
and the WishListService
component. Both of these components are CMS driven and can be configured in SmartEdit. You can also customize these components in Spartacus using CMS component mapping. For more information, see Customizing CMS Components.
Limitations
A user cannot have more than one wish list. Furthermore, each wish list is tied to a specific user, so a wish list cannot be shared with other users. Finally, it is not possible to add a product to a wish list if that product is out of stock.
Disabling Wish Lists
The wish list feature is enabled by default in Spartacus.
The only way to disable wish lists is through the CMS. You can disable wish lists by making changes to the spartacussampledata
extension, or to your custom AddOn, as follows:
-
Remove the
WishListLink
by removing the following line from the relevantcms-responsive-content.impex
files:;;WishListLink;Wish List Link;/my-account/wishlist;WishListLink;WishListLink;;loggedInUser
Note: There is a
cms-responsive-content.impex
file for each base site. -
Remove the link from the
SiteLinksSlot
by removingWishListLink
from the following line in the relevantcms-responsive-content.impex
files:;;SiteLinksSlot;Slot contains some links;true;OrdersLink,WishListLink,StoreFinderLink,ContactUsLink,HelpLink
-
Remove the
WishListNavNode
by removing the following line from the relevantcms-responsive-content.impex
files:;WishListNavNode;;Wish List;MyAccountNavNode;;WishListNavNode
-
Remove the
WishListNavNodeEntry
by removing the following line from the relevantcms-responsive-content.impex
files:;WishListNavNodeEntry;;WishListNavNodeEntry;WishListNavNode;WishListLink;
-
Remove all references of
WishListPage
,BodyContentSlot-wishList
,WishListComponent
andAddToWishListComponent
.
You can also do these steps in Backoffice.